# -*- coding: utf-8 -*-
# @Time : 2022/1/4 19:34
# @Author : Limusen
# @File : config_utils


import os
import configparser

current_path = os.path.dirname(os.path.abspath(__file__))
conf_path = os.path.join(current_path, '..', 'config', 'config.ini')


class ConfigUtils:

    def __init__(self):
        self.cfg = configparser.ConfigParser()
        self.cfg.read(conf_path, encoding="utf-8")

    @property
    def get_host(self):
        return self.cfg.get("DEFAULT", "url")

    @property
    def time_out(self):
        return self.cfg.get("DEFAULT", "time_out")

    @property
    def driver_name(self):
        return self.cfg.get("DEFAULT", "driver_name")

    @property
    def chrome_path(self):
        return self.cfg.get("PATH", "chrome_path")

    @property
    def firfox_path(self):
        return self.cfg.get("PATH", "firfox_path")

    @property
    def edge_path(self):
        return self.cfg.get("PATH", "edge_path")

    @property
    def case_path(self):
        return self.cfg.get("PATH", "case_path")


    @property
    def report_path(self):
        return self.cfg.get("PATH", "report_path")

    @property
    def log_level(self):
        return int(self.cfg.get("LOG", "log_level"))


local_config = ConfigUtils()
